#ifndef __MEBSP_DEVCOM_IN_H
#define __MEBSP_DEVCOM_IN_H 			   
  
#include "at32f403a_407.h"
#include <stdint.h>

//DMX发送时修改波特率,主要为了发送break 176us
#define MB_DEVCOM_IN_BAUD_BREAK_SPEED  (0x07D0)  //60000波特率 分频数
#define MB_DEVCOM_IN_BAUD_RUN_SPEED    (0x01E0)  //250000 波特率

enum {
	MB_DEVCOM_IN_LINE_SEND_IDLE 					= 0, 
	MB_DEVCOM_IN_LINE_SEND_START,
  MB_DEVCOM_IN_LINE_SEND_NORMAL,
};

enum {
	MB_DEVCOM_IN_LINE_RECV_IDLE 					= 0, 
	MB_DEVCOM_IN_LINE_RECV_ERR,
  MB_DEVCOM_IN_LINE_RECV_NORMAL,
};

typedef struct
{
  uint8_t cTransmitlineState;

  uint8_t bRecvOKFlag;
  uint8_t bRecvIsConnFlag;
  uint8_t cRecvLineState;
  uint16_t wRecvLengthVal;

  uint16_t wRecvErrOutTimeCnt;
  
  uint16_t wTransmitCount;
  uint16_t wTransmitLength;
  uint8_t  *pTransmitBuff;
  uint16_t wTransmitDelayCnt;
  uint16_t wTransmitErrTimeCnt;
  
}_MB_DEVCOMIN_T;

extern _MB_DEVCOMIN_T MB_DevComIn;

extern void MeBsp_DevComIn_Init(void);
extern void MeBsp_DevComIn_Hanl(void);
extern void MeBsp_DevCom_In_Send(void);
#endif





























